package org.shuma.supplier.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.shuma.supplier.domain.entity.Supplier;

/**
 * @author :Wjh
 * @since :2024/6/17 上午11:54
 */

@Mapper
public interface SupplierMapper extends BaseMapper<Supplier> {
    @Select("select * from supplier where `supplier_name` = #{name}")
    Supplier getSupplierByName(String name);

    @Update("update supplier set `supplier_name` = #{supplierName},`supplier_phone` = #{supplierPhone},`create_time` = #{createTime},`update_time` = #{updateTime},`is_delete` = #{isDelete}" +
            " where `supplier_id` = #{supplierId}")
    void updateSupplierById(Supplier supplier);
}
